package ccnu.agile.config.envcheck;

import ccnu.agile.service.IEnvironmentCheckService;
import ccnu.agile.utils.LogUtils;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;

import javax.annotation.PostConstruct;

/**
 * @Description: 环境监察配置类
 * @Author: JreamY
 * @Date: 2021/10/22
 **/
@Configuration
@DependsOn({"environmentCheckService"})
public class EnvironmentCheck {

    private IEnvironmentCheckService environmentCheckService;

    public EnvironmentCheck(IEnvironmentCheckService environmentCheckService) {
        this.environmentCheckService = environmentCheckService;
    }

    @PostConstruct
    public void environmentCheck() {

        LogUtils.info(this, "------------------------environment check start----------------------");
        environmentCheckService.healthCheck();
        LogUtils.info(this, "------------------------environment check end----------------------");
    }

}
